package com.lithium.extractors;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

import com.lithium.common.Medication;

public class MedicationExtractor implements ResultSetExtractor {

	@Override
	public Object extractData(ResultSet arg0) throws SQLException,
			DataAccessException {
		
		//select  medication_id, medication_title, medication_format, med_ingredient_id, lang_locale from med_title_comments where med_comment_title = ? ",
		Medication med = new Medication();
		med.setMedication_id(arg0.getInt(1));
		med.setTitle(arg0.getString(2));
		med.setFormato(arg0.getString(3));
		med.setIngredient_id(arg0.getInt(4));

		return med;
	}

}
